Boolean Algebra
Boolean algebra is the branch of algebra in which the values of the variables and constants have exactly two values: true and false , usually denoted 1 and 0 respectively.
Operators
The basic operators in Boolean algebra are AND , OR , and NOT .
The secondary operators are eXclusive OR (often called XOR ) and eXclusive NOR ( XNOR , sometimes called equivalence ). They are secondary in the sense that they can be composed from the basic operators.
- The AND of two values is true only whenever both values are true. It is written as xy or x⋅y. The values of and for all possible inputs is shown in the following truth table:
x | y | xy |
---|---|---|
0 | 0 | 0 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 1 |
- The OR of two values is true whenever either or both values are true. It is written as x+y. The values of or for all possible inputs is shown in the following truth table:
x | y | x+y |
---|---|---|
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 1 |
- The NOT of a value is its opposite; that is, the not of a true value is false whereas the not of a false value is true. It is written as
or ¬x. The values of not for all possible inputs is shown in the following truth table:
x | |
---|---|
0 | 1 |
1 | 0 |
- The XOR of two values is true whenever the values are different. It uses the ⊕ operator, and can be built from the basic operators: x⊕y=
The values of xor for all possible inputs is shown in the following truth table:
x | y | x⊕y |
---|---|---|
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 0 |
- The XNOR of two values is true whenever the values are the same. It is the NOT of the XOR function. It uses the ⊙ operator: x⊙y=
. The xnor can be built from basic operators: x⊙y=xy + The values of xnor for all possible inputs is shown in the following truth table:
x | y | x⊙y |
---|---|---|
0 | 0 | 1 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 1 |
Just as algebra has basic rules for simplifying and evaluating expressions, so does Boolean algebra.
Laws
A law of Boolean algebra is an identity such as x+(y+z)=(x+y)+z between two Boolean terms, where a Boolean term is defined as an expression built up from variables, the constants 0 and 1, and operations and , or , not , xor , and xnor .
Like ordinary algebra, parentheses are used to group terms. When a not is represented with an overhead horizontal line, there is an implicit grouping of the terms under the line. That is,
Order of Precedence
The order of operator precedence is
- not
- and
- xor
- xnor
- or
Operators with the same level of precedence are evaluated from left-to-right.
Fundamental Identities
Law | Example |
---|---|
Commutative Law – The order of application of two separate terms is not important. | x+y=y+x , x⋅y=y⋅x |
Associative Law – Regrouping of the terms in an expression doesn't change the value of the expression. | (x+y)+z = x+(y+z) , x⋅(y⋅z)=(x⋅y)⋅z |
Idempotent Law – A term that is or' ´ed or and ´ed with itself is equal to that term. | x+x=x , x⋅x=x |
Annihilator Law – A term that is or' ´ed with 1 is 1; a term and ´ed with 0 is 0. | x+1=1, x⋅0=0 |
Identity Law – A term or ´ed 0 or and ´ed with a 1 will always equal that term. | x+0=x , x⋅1=x |
Complement Law – A term or ´ed with its complement equals 1 and a term and ´ed with its complement equals 0. | |
Absorptive Law – Complex expressions can be reduced to a simpler ones by absorbing like terms. | x+xy=x, x+ |
Distributive Law – It's OK to multiply or factor-out an expression. | x⋅(y+z)=xy+xz, (x+y)⋅(p+q)=xp+xq+yp+yq, (x+y)(x+z)=x+yz |
DeMorgan's Law – An or ( and ) expression that is negated is equal to the and ( or ) of the negation of each term. | |
Double Negation – A term that is inverted twice is equal to the original term. | |
Relationship between XOR and XNOR |
Sample Problems
Problems in this category are typically of the form "Given a Boolean expression, simplify it as much as possible" or "Given a Boolean expression, find the values of all possible inputs that make the expression true ." Simplify means writing an equivalent expression using the fewest number of operators.
Boolean Algebra
Simplify the following expression as much as possible:
Boolean Algebra
Find all orderd pairs (A,B) that make the following expression true :